package gameHandling;

import main.Factory;
import gameObject.Monster;
import gameObject.item.ItemArm;
import gameObject.item.ItemSuit;

public class MonsterRush {
	private int startTime;
	private int numMonster;
	private int waitTime;
	private int monsterID;
	private int armID;
	private int suitID;
	private int level;
	private int money;
	//private Monster monster;

	public MonsterRush(int monsterID,int armID,int suitID,int level,int money,
			int startTime, int waitTime, int numMonster) {
		this.startTime = startTime;
		this.numMonster = numMonster;
		this.waitTime = waitTime;
		this.monsterID = monsterID;
		this.armID = armID;
		this.suitID = suitID;
		this.level = level;
		this.money = money;
	}

	public boolean isRush(int t) {
		if (t < startTime ) {
			return false;
		}
		return (t - startTime) % waitTime == 0;
	}
	public boolean isEndRush(int t) {
		return t >= startTime+waitTime*(numMonster-1);
	}

	public Monster getMonster() {
		Monster monster = Factory.createMonster(monsterID,level,money);
		if(armID!= -1)
		{
			monster.setArm((ItemArm)Factory.createItem(armID));
		}
		if(suitID!= -1)
		{
			monster.setSuit((ItemSuit)Factory.createItem(suitID));
		}
		return monster;
	}
}
